home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
amiga
/
AmigaGuide.mod
next >
Wrap
Text File
|
1995-06-29
|
12KB
|
380 lines
(**************************************************************************
$RCSfile: AmigaGuide.mod $
Description: Interface to amigaguide.library
Created by: fjc (Frank Copeland)
$Revision: 3.8 $
$Author: fjc $
$Date: 1995/06/04 23:13:14 $
Includes Release 40.15
(C) Copyright 1990-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A Interface Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
*************************************************************************)
<* STANDARD- *>
MODULE [2] AmigaGuide;
IMPORT
SYS := SYSTEM, Kernel, e := Exec, u := Utility, d := Dos,
i := Intuition, s := Sets;
TYPE
(**-- Pointer declarations ---------------------------------------------*)
AmigaGuideMsgPtr * = POINTER TO AmigaGuideMsg;
ContextTablePtr * = POINTER TO ContextTable;
NewAmigaGuidePtr * = POINTER TO NewAmigaGuide;
XRefPtr * = POINTER TO XRef;
AmigaGuideHostPtr * = POINTER TO AmigaGuideHost;
OpFindHostPtr * = POINTER TO OpFindHost;
OpNodeIOPtr * = POINTER TO OpNodeIO;
OpExpungeNodePtr * = POINTER TO OpExpungeNode;
(**-- Library definitions ----------------------------------------------*)
CONST
apshToolId * = 11000;
startupMsgId * = apshToolId+1; (* Startup message *)
loginToolId * = apshToolId+2; (* Login a tool SIPC port *)
logoutToolId * = apshToolId+3; (* Logout a tool SIPC port *)
shutdownMsgId * = apshToolId+4; (* Shutdown message *)
activateToolId * = apshToolId+5; (* Activate tool *)
deactivateToolId * = apshToolId+6; (* Deactivate tool *)
activeToolId * = apshToolId+7; (* Tool Active *)
inactiveToolId * = apshToolId+8; (* Tool Inactive *)
toolStatusId * = apshToolId+9; (* Status message *)
toolCmdId * = apshToolId+10; (* Tool command message *)
toolCmdReplyId * = apshToolId+11; (* Reply to tool command *)
shutdownToolId * = apshToolId+12; (* Shutdown tool *)
(* Attributes accepted by GetAmigaGuideAttr() *)
agaDummy * = u.user;
path * = agaDummy+1;
xrefList * = agaDummy+2;
activate * = agaDummy+3;
context * = agaDummy+4;
helpGroup * = agaDummy+5; (* e.ULONG: Unique identifier *)
agaReserved1 * = agaDummy+6;
agaReserved2 * = agaDummy+7;
agaReserved3 * = agaDummy+8;
aRexxPort * = agaDummy+9;
(* e.MsgPortPtr: Pointer to the ARexx message port (V40) *)
arexxPortName * = agaDummy+10;
(* e.LSTRPTR: Used to specify the ARexx port name (V40) (not copied) *)
TYPE
AGContext * = POINTER TO RECORD END;
AmigaGuideMsg * = RECORD (e.MessageBase)
msg * : e.Message; (* Embedded Exec message structure *)
type * : e.ULONG; (* Type of message *)
data * : e.APTR; (* Pointer to message data *)
dSize * : e.ULONG; (* Size of message data *)
dType * : e.ULONG; (* Type of message data *)
priRet * : e.ULONG; (* Primary return value *)
secRet * : e.ULONG; (* Secondary return value *)
system1 * : e.APTR;
system2 * : e.APTR;
END;
(* Allocation description structure *)
ContextTable * = ARRAY MAX(INTEGER) OF e.LSTRPTR;
NewAmigaGuide * = RECORD
lock * : d.FileLockPtr; (* Lock on the document directory *)
name * : e.LSTRPTR; (* Name of document file *)
screen * : i.ScreenPtr; (* Screen to place windows within *)
pubScreen * : e.LSTRPTR; (* Public screen name to open on *)
hostPort * : e.LSTRPTR; (* Application's ARexx port name *)
clientPort * : e.LSTRPTR; (* Name to assign to the clients ARexx port *)
baseName * : e.LSTRPTR; (* Base name of the application *)
flags * : s.SET32; (* Flags *)
context * : ContextTablePtr; (* NULL terminated context table *)
node * : e.LSTRPTR; (* Node to align on first (defaults to Main) *)
line * : LONGINT; (* Line to align on *)
extens * : u.TagListPtr; (* Tag array extension *)
client * : e.APTR; (* Private! MUST be NULL *)
END;
CONST
(* public Client flags *)
loadIndex * = 0; (* Force load the index at init time *)
loadAll * = 1; (* Force load the entire database at init *)
cacheNode * = 2; (* Cache each node as visited *)
cacheDB * = 3; (* Keep the buffers around until expunge *)
unique * = 15; (* Unique ARexx port name *)
noActivate * = 16; (* Don't activate window *)
sysGads * = 31;
(* Callback function ID's *)
open * = 0;
close * = 1;
notEnoughMemory * = 100;
cantOpenDatabase * = 101;
cantFindNode * = 102;
cantOpenNode * = 103;
cantOpenWindow * = 104;
invalidCommand * = 105;
cantComplete * = 106;
portClosed * = 107;
cantCreatePort * = 108;
keywordNotFound * = 113;
TYPE
(* Cross reference node *)
XRef * = RECORD (e.NodeBase)
node * : e.Node; (* Embedded node *)
pad * : e.UWORD; (* Padding *)
df * : e.APTR (*DocFilePtr*); (* Document defined in *)
file * : e.LSTRPTR; (* Name of document file *)
name * : e.LSTRPTR; (* Name of item *)
line * : LONGINT; (* Line defined at *)
END;
CONST
XRSize * = SIZE (XRef);
(* Types of cross reference nodes *)
generic * = 0;
function * = 1;
command * = 2;
include * = 3;
macro * = 4;
struct * = 5;
field * = 6;
typedef * = 7;
define * = 8;
TYPE
(* Callback handle *)
AmigaGuideHost * = RECORD (u.HookBase)
dispatcher * : u.Hook; (* Dispatcher *)
reserved * : e.ULONG; (* Must be 0 *)
flags * : s.SET32;
useCnt * : e.ULONG; (* Number of open nodes *)
systemData : e.APTR; (* Reserved for system use *)
userData * : e.APTR; (* Anything you want... *)
END;
CONST
(* Methods *)
findNode * = 1;
openNode * = 2;
closeNode * = 3;
expunge * = 10; (* Expunge DataBase *)
TYPE
MethodBase *= RECORD END;
Method * = RECORD (MethodBase)
ID * : e.ULONG;
END;
(* hmFindnode *)
OpFindHost * = RECORD (MethodBase)
method * : Method;
attrs - : u.TagListPtr; (* R: Additional attributes *)
node - : e.LSTRPTR; (* R: Name of node *)
TOC * : e.LSTRPTR; (* W: Table of Contents *)
title * : e.LSTRPTR; (* W: Title to give to the node *)
next * : e.LSTRPTR; (* W: Next node to browse to *)
prev * : e.LSTRPTR; (* W: Previous node to browse to *)
END;
(* hmOpennode, hmClosenode *)
OpNodeIO * = RECORD (MethodBase)
method * : Method;
attrs - : u.TagListPtr; (* R: Additional attributes *)
node - : e.LSTRPTR; (* R: Node name and arguments *)
fileName * : e.LSTRPTR; (* W: File name buffer *)
docBuffer * : e.LSTRPTR; (* W: Node buffer *)
buffLen * : e.ULONG; (* W: Size of buffer *)
flags * : s.SET32; (* RW: Control flags *)
END;
CONST
(* OpNodeIO.flags *)
keep * = 0; (* Don't flush this node until database is
* closed. *)
reserved1 * = 1; (* Reserved for system use *)
reserved2 * = 2; (* Reserved for system use *)
ascii * = 3; (* Node is straight ASCII *)
reserved3 * = 4; (* Reserved for system use *)
clean * = 5; (* Remove the node from the database *)
done * = 6; (* Done with node *)
(* OpNodeIO.attrs *)
htnaDummy * = u.user;
htnaScreen * = htnaDummy+1; (* i.ScreenPtr: Screen that window resides in *)
htnaPens * = htnaDummy+2; (* Pen array (from DrawInfo) *)
htnaRectangle * = htnaDummy+3; (* Window box *)
htnaHelpGroup * = htnaDummy+5; (* e.ULONG: unique identifier *)
TYPE
(* hmExpunge *)
OpExpungeNode * = RECORD (MethodBase)
method * : Method;
attrs - : u.TagListPtr; (* R: Additional attributes *)
END;
(**-- Library Base variable --------------------------------------------*)
CONST
amigaguideName * = "amigaguide.library";
VAR
base* : e.LibraryPtr;
(**-- Library Functions ------------------------------------------------*)
(*--- functions in V40 or higher (Release 3.1) ---*)
(* Public entries *)
PROCEDURE LockAmigaGuideBase* [base,-36]
( handle [8] : AGContext )
: LONGINT;
PROCEDURE UnlockAmigaGuideBase* [base,-42]
( key [0] : LONGINT );
PROCEDURE OpenAmigaGuideA* [base,-54]
( VAR nag [8] : NewAmigaGuide;
attrs [9] : ARRAY OF u.TagItem )
: AGContext;
PROCEDURE OpenAmigaGuide* [base,-54]
( VAR nag [8] : NewAmigaGuide;
attrs [9]..: u.Tag )
: AGContext;
PROCEDURE OpenAmigaGuideAsyncA* [base,-60]
( VAR nag [8] : NewAmigaGuide;
attrs [0] : ARRAY OF u.TagItem )
: AGContext;
PROCEDURE OpenAmigaGuideAsync* [base,-60]
( VAR nag [8] : NewAmigaGuide;
attrs [0]..: u.Tag )
: AGContext;
PROCEDURE CloseAmigaGuide* [base,-66]
( cl [8] : AGContext );
PROCEDURE AmigaGuideSignal* [base,-72]
( cl [8] : AGContext )
: e.ULONG;
PROCEDURE GetAmigaGuideMsg* [base,-78]
( cl [8] : AGContext )
: AmigaGuideMsgPtr;
PROCEDURE ReplyAmigaGuideMsg* [base,-84]
( amsg [8] : AmigaGuideMsgPtr );
PROCEDURE SetAGContextA* [base,-90]
( cl [8] : AGContext;
id [0] : e.ULONG;
attrs [1] : ARRAY OF u.TagItem )
: BOOLEAN;
PROCEDURE SetAGContext* [base,-90]
( cl [8] : AGContext;
id [0] : e.ULONG;
attrs [1] ..: u.Tag )
: BOOLEAN;
PROCEDURE SendAGContextA* [base,-96]
( cl [8] : AGContext;
attrs [0] : ARRAY OF u.TagItem )
: BOOLEAN;
PROCEDURE SendAGContext* [base,-96]
( cl [8] : AGContext;
attrs [0]..: u.Tag )
: BOOLEAN;
PROCEDURE SendAmigaGuideCmdA* [base,-102]
( cl [8] : AGContext;
cmd [0] : ARRAY OF CHAR;
attrs [1] : ARRAY OF u.TagItem )
: BOOLEAN;
PROCEDURE SendAmigaGuideCmd* [base,-102]
( cl [8] : AGContext;
cmd [0] : ARRAY OF CHAR;
attrs [1]..: u.Tag )
: BOOLEAN;
PROCEDURE SetAmigaGuideAttrsA* [base,-108]
( cl [8] : AGContext;
attrs [9] : ARRAY OF u.TagItem )
: LONGINT;
PROCEDURE SetAmigaGuideAttrs* [base,-108]
( cl [8] : AGContext;
attrs [9]..: u.Tag )
: LONGINT;
PROCEDURE GetAmigaGuideAttr* [base,-114]
( tag [0] : u.Tag;
cl [8] : AGContext;
VAR storage [9] : e.APTR )
: LONGINT;
PROCEDURE LoadXRef* [base,-126]
( lock [8] : d.FileLockPtr;
name [9] : ARRAY OF CHAR )
: LONGINT;
PROCEDURE ExpungeXRef* [base,-132] ();
PROCEDURE AddAmigaGuideHostA* [base,-138]
( h [8] : u.HookBasePtr;
name [0] : ARRAY OF CHAR;
attrs [9] : ARRAY OF u.TagItem )
: AmigaGuideHostPtr;
PROCEDURE AddAmigaGuideHost* [base,-138]
( h [8] : u.HookBasePtr;
name [0] : ARRAY OF CHAR;
attrs [9]..: u.Tag )
: AmigaGuideHostPtr;
PROCEDURE RemoveAmigaGuideHostA* [base,-144]
( hh [8] : AmigaGuideHostPtr;
attrs [9] : ARRAY OF u.TagItem )
: LONGINT;
PROCEDURE RemoveAmigaGuideHost* [base,-144]
( hh [8] : AmigaGuideHostPtr;
attrs [9]..: u.Tag )
: LONGINT;
PROCEDURE GetAmigaGuideString* [base,-210]
( id [0] : LONGINT )
: e.LSTRPTR;
(**-- Library Base variable --------------------------------------------*)
(**-----------------------------------*)
PROCEDURE* [0] CloseLib (VAR rc : LONGINT);
BEGIN (* CloseLib *)
IF base # NIL THEN e.CloseLibrary (base) END
END CloseLib;
BEGIN
base := e.OpenLibrary (amigaguideName, e.libraryMinimum);
IF base # NIL THEN Kernel.SetCleanup (CloseLib) END
END AmigaGuide.